package com.pioneer.gui.invoice.view;

import com.pioneer.gui.invoice.model.InvoiceModel;
import com.pioneer.gui.invoice.model.InvoiceTableModel;

import com.pioneer.gui.invoice.controller.DetailsTableCellRenderer;


import java.awt.Component;
import java.awt.GridLayout;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;

import javax.swing.JPanel;
import javax.swing.JLabel;
import javax.swing.JTable;
import javax.swing.JTextField;
import javax.swing.JScrollPane;
import javax.swing.JComboBox;
import javax.swing.table.DefaultTableCellRenderer;

import javax.swing.event.TableModelListener;
import javax.swing.event.TableModelEvent;

import javax.swing.event.TableModelEvent;


public class DetailsTable
extends JTable
{
	
	public DetailsTable(InvoiceModel model)
	{
		    //InvoiceTableModel invoiceTableModel=new InvoiceTableModel(model,this);
	    InvoiceTableModel invoiceTableModel=model.getInvoiceDetails();
		    //model.addChangeListener(new InvoiceModeltoInvoiceTableModelAdapter(model,invoiceTableModel));
		this.setModel(invoiceTableModel);
			//try
			{
				//DefaultTableCellRenderer defaultTableCellRenderer=new DefaultTableCellRenderer();
				//DetailsTableCellRenderer defaultTableCellRenderer=new DetailsTableCellRenderer();
				//defaultTableCellRenderer.setBackground(java.awt.Color.red);
				//this.setDefaultRenderer(Class.forName("java.lang.String"), defaultTableCellRenderer);
			}
			//catch (ClassNotFoundException ex)
			{
			}
	}
		
	public void refresh()
	{
			//this.revalidate();
	    	this.repaint();
    }
}